package com.rjxy.plansystemmanagement.mapper;

import com.rjxy.plansystemmanagement.entity.HotelOrderInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper
public interface HotelOrderMapper {
    @Select("select * from HotelOrderInfo")
    List<HotelOrderInfo> list();

    @Delete("delete from HotelOrderInfo where ID = #{ID}")
    void deleteHotelOrder(Integer ID);

    @Insert("insert into HotelOrderInfo(UserID,HotelID,RoomNum,RoomType,RZTime,TFTime,Price,PayWay,status)" +
    "VALUES (#{UserID},#{HotelID},#{RoomNum},#{RoomType},#{RZTime},#{TFTime},#{Price},#{PayWay},#{status})")
    void addHotelOrder(HotelOrderInfo hotelOrderInfo);

    @Select("select * from HotelOrderInfo where ID = #{ID}")
    HotelOrderInfo getHotelOrderById(Integer ID);

    @Select("select * from HotelOrderInfo where UserID = #{id}")
    List<HotelOrderInfo> getHotelOrderByUid(Integer id);

    void updateHotelOrder(HotelOrderInfo hotelOrderInfo);

    @Select("select * from HotelOrderInfo where status = #{status}")
    List<HotelOrderInfo> getHotelOrderByStatus(String status);
}
